package com.lzb.newloan.utils;

import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.FragmentActivity;


public abstract class BaseActivity extends FragmentActivity  {


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		ActivityList.addActiviy(this);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		super.onCreate(savedInstanceState);
	}

	public abstract void processMessage(Message message);

	private static Handler handler = new Handler() {
		public void handleMessage(Message msg) {
			ActivityList.getLastActivity().processMessage(msg);
		}
	};



	public static void sendMsg(Message msg) {
		handler.sendMessage(msg);
	}

	@Override
	protected void onDestroy() {
		// ActivityList.removeActivity(this);
		super.onDestroy();
	}


}
